/**
 * @author Steve Gao<gaofu@parllay.com>
 */
const BaseHandler     = require('../base-handler');
const HTTP_VERBS      = require('../../../constants').HTTP_VERBS;

class WallPhotosFrontendHandler extends BaseHandler {

    get pattern() {
        return '/walls/:wall_id/fans';
    }

    doGET(request, response) {
        if(!request.session.user.authenticated) {
            response.redirect('/login');
        } else {
            response.render('console/wall_users', {
                user: request.session.user,
                wall_id: request.params.wall_id
            });
        }
    }

    setup() {
        this.registerVerb(HTTP_VERBS.GET, this.doGET);
    }
}

module.exports = WallPhotosFrontendHandler;